On the placement of Spheres, Cylinders and Rectangles

Spheres

Spheres are relatively simple to place. Their co-ordinates mark their exact centre and thus are easily dealt with. There is however an inherent problem that if you sphere is big and/or dense then it turns into a big square. A highly annoying point, however don't despair! If you have been following the tutorial then you will see I have already covered this using my favourite solution, but there are a number of ways around this. I refer you to a discussion from the Relic Editing Message Board sparked off by Obithrawn;

[Obithrawn] Its pretty much impossible to make an actually sphere of cylinder in homeworld, when you do, it always ends up looking like a square, especially if it is a really thick 'sphere'

[*TAKER*] I have made some pretty good looking spheres by using four cylinders in the same location. The cylinders have a length exactly twice their radius. I have two larger ones and two smaller ones. One of each type is rotated 45 and 45 and this will give you a nice sphere a little denser towards the middle like a globular cluster.

If you wanted to make bigger ones you could by using several cylinders again of the same x/y/z dimensions and rotating them slightly off from one another. If you want a uniform density I would think you could construct one by making several cylinders of various sizes and constructing it by placing smaller ones on the sides of the larger ones.

[Hellhawk666] Regarding making nice neat spheres, try placing a number of ordinary spheres on the same centre co-ordinates but with increasing radii. Don't make the spheres too densely populated, and make the last couple shells instead of spheres - they seem to maintain a neater shape than ordinary spheres.

Cylinders

Ah, Cylinders. These are the toughest things to deal with. Quite frankly these are a nightmare. If you can get access to MS Excel then you are laughing, if you can't or won't then using cylinders will require a bit of work.

A Cylinder is a long tube of asteroids, the radius of the cylinder as well as its length is easily controlled. However they are straight lines and do not turn, so to create rings (See 'Genesis 240D') or just weird 'streams' of asteroids (see 'Fields of Plaz') you need more than one cylinder all set end to end. To do this you need to know your trigonometry. (SOHCAHTOA!)

Say you want to put 24 cylinders end to end to form a ring. If you have access to MS Excel then its just a matter of downloading the Homeworld Excel Mapper spreadsheet from BPLlamas site; 'The Homeworld Map Archive', inputting the radius and axial tilt you want this circle to have and then saving the results as a *.csv file. Copying that into your resources file and viola!; One ring of asteroids. 

Without Excel, and until someone writes a spreadsheet for lotus 123 or any other spreadsheet package you have access to, then its trig and hard graft for you. 

What you need to do to link two cylinders together is to work out at what co-ordinates the ends of the each cylinder are. Its easier if you have drawn out the end points of each cylinder and you work back to find out what the central co-ordinates are and these co-ordinates are then added to your resources file.

I'm not going to go into all the maths of how you work out the length of your cylinder in 3D, and the angle of rotation (both roty and rotz), as after I wrote the Homeworld Excel Mapper I promptly forgot it all again. But I can give you a couple documents where I got everything (including Links) I needed to relearn all that trig if you need it. Try 'An Overview of Trigonometry' or 'Trigonometry - A Crash Review' in the Help Texts Folder
 Rectangles

Rectangles are very flat, these are completely 2D shapes, good for backgrounds I suppose. They are rarely (if ever) used. I can't think of a single example other than one of the single player missions where I dredged it up using the Big viewer. They are, I'm told, used in MissionMan.

Take note that they differ from cylinders in that they have a length and width as opposed to a radius and length, otherwise they can be regarded as a 2D cylinder and can be used in exactly the same way.

-------------------------------------------------------------

Tutorial Map Part Seventeen

Ok, we will now finish of the 2 player map by adding in a central region of asteroids with its CPU defended station to make it a dangerous place to go.

The central sphere will be a huge cluster of dust in an overlarge ball, again we will follow Hellhawk666's example on how to create these and retain their spherical shape.

First lets add a DustCloud sphere in the centre to hide our Station in. Copy a resource line and rename the 'Resources   Asteroid' to 'Resources   DustCloud'. We want this cloud in the centre of our map so posx,posy,posz will be 0,0,0. Next rename the layout to 'Sphere'. The Distribution of the file will be 'DustCloud.dist' because we have named the resourcetype (the first parameter in the line) as 'DustCloud'. Drop the resourceNum to '16', we don't need it too dense. The radius and diameter change to '3000' and '6000' respectively. We have no need for any axial tilt so set them to '0' and we don't want them to regenerate so lets make sure that the properties all are set at '?'.

Copy this line and in the second line we will make a slightly larger sphere, all we need to change in our second line is the radius and diameter, change them to '10000' and '20000'. 

The last thing you need to do is make sure you have the relevant distribution file in your Revelations2 folder, so make sure you have DustCloud.dist in there, if not it can be found in the Tutorial Map files folder.

Next; the dust ball that will comprise our central region. Ok you know what you are doing with this so rather than talk you through it all I will explain what I did. 

I created 12 spheres all centred on the dead centre of the map at co-ordinates 0,0,0, then I made sure they were all spheres of Tiny.dist distribution with a resourceNum of 250, this whopping number was needed because the spheres are so big. I made the radius for each sphere slightly larger than the one before it and to retain the spherical shape I made the last 6 spheres shells using property '2'.Here they are in full;

Resources    DustCloud,0,0,0,Sphere,DustCloud.dist,16,3000,6000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,10000,20000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,12000,24000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,14000,28000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,16000,32000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,18000,36000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,19000,38000,0,0,     ?,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,20000,40000,0,0,     2,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,22000,45000,0,0,     2,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,24000,50000,0,0,     2,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,25000,50000,0,0,     2,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,26000,52000,0,0,     2,     ?
Resources    Asteroid,0,0,0,Sphere,Tiny.dist,250,27000,54000,0,0,     2,     ?

So that's the resources completed for our 2 player (1v1) map. I created these by jumping in and out of homeworld and tweaking them until I was happy. Go take a look at them for yourself in homeworld. All that remains to add is our station and its defending weaponry, the large and small guns found in the singleplayer junkyard mission 'The Karos Graveyard'. Everything you need is here, there is nothing stopping you going and doing it for yourself but I will talk you through the addition of CPU controlled ships in Multiplayer missions.

-------------------------------------------------------------


On the Addition of CPU controlled ships in Multiplayer missions

Any ship of any race that has been included in the relevant section of the level file can be added into the ResourceSphere file or a CPU only file with the 'PlayerNumber' set as '-1', these ships will then be under CPU control. There is however a drawback to this. If you try adding a squadron of fighters then this becomes immediately apparent, the ships won't move other than to manoeuvre themselves into firing positions to return fire if they are attacked. This is alright for fixed emplacements so you could happily add the guns you have already seen on the single player Junkyard mission or some of the heavier ships and they then become viable targets for salvage (see Medamanx's map; 'Dustiness', or the classic BPLlama map; 'Debris Field').

If you want an alien race to involve itself in offensive operations (and by this I mean actively attacking other players, not involving themselves in degrading and vile act of unspeakable filth) then you need to have these ships in a Mothership file as a player. (see 'Streamers', again by BPLlama).

Its simplicity itself to add these ships in, just make sure you have included them in the level file and they are named correctly in the ship lines, done in exactly the same way you do your players starting fleet whether they are in the ResourceSphere or Mothership files.


-------------------------------------------------------------

Tutorial Map Part Eighteen

We are going to add a Research Station in the dead centre of our map and surround it with 4 walls of Autoguns sitting 2000m away along each of the axis.

In the your Revelations2 folder, open up the 'Mothership_1.missphere' file and the 'ResourceSphere_0.missphere' files. Copy the first ship line, the Mothership line from the Mothership file into the ResourceSphere file, this line;

Ships     ,0.0,50000.0,0.0,-90.0,R1,Mothership,1,NULL_FORMATION|?|?,?,?

This is going to be our Research Station. Change the co-ordinates to '0,0,0' so it sits at the dead centre of our map and change its facing to '0' Looking at the Relic Object list we see there race is 'Traders' and its written as 'ResearchStation' so change the R1 and Mothership values accordingly. We only want one of them and the formation is NULL_FORMATION which I find always sits well with the bigger ships (those you usually add in singly), so leave these values. That's our Station done, its that simple.

Lets add the Auto Guns. We want four groups so copy the Research Station line four times. On the first we will have them sitting 2000m to the 'North' or +y axis, simply change the co-ordinates to '0,2000,0' and we want them facing this direction so change their facing (rot) to '90' (Always remember x=0 and the angle is measured anticlockwise), the second group to the 'East' so they have co-ordinates '2000,0,0' and rot of '0', the third co-ordinates are '0,-2000,0', rot is '-90', the fourth group I will leave you to puzzle over yourself. Did you get it? Wadda you mean a five year old could have got that? 

Ok then smartypants lets continue along the line, the race of the Auto Guns is 'Traders', so that's fine. The ship names we get from the Relic Object listings and they are 'Junk_Lgun' and 'Junk_Sgun', make the North and South the Large guns and the East and west the Small guns. We want to have '6' in each group and we want them in 'WALL_FORMATION'. Nothing special about them although we can do funky thing like making them invisible to sensors if we wanted but we wont bother. Your completed lines should look like this;

Ships     ,0.0,0.0,0.0,0.0,Traders,ResearchStation,1,NULL_FORMATION|?|?,0,?
Ships     ,0.0,2000.0,0.0,90.0,Traders,Junk_Lgun,6,WALL_FORMATION|?|?,0,?
Ships     ,-2000.0,0.0,0.0,180.0,Traders,Junk_Sgun,6,WALL_FORMATION|?|?,0,?
Ships     ,0.0,-2000.0,0.0,-90.0,Traders,Junk_Lgun,6,WALL_FORMATION|?|?,0,?
Ships     ,2000.0,0.0,0.0,0.0,Traders,Junk_Sgun,6,WALL_FORMATION|?|?,0,?

And that's it. You have completed your 1v1 version of your map. The toughest part is over and all that remains is putting in players 3, 4, 5 and 6.

-------------------------------------------------------------


 